package rmi;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

public class Server {
	/**
	 * @author NeverDie
	 * @since 2012.9.18~9.21
	 */
	
	MySQLConnection database;

	
	public Server(){
		try {

		database = new MySQLConnection();
			
		LocateRegistry.createRegistry(8001);
		
		Naming.bind("rmi://localhost:8001/DATABASE", database);
		} catch (RemoteException | MalformedURLException | AlreadyBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Server();
	}

}
